home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HamCall (October 1991)
/
HamCall (Whitehall Publishing)(1991).bin
/
bcast
/
miscbcst
/
stlrfb.bas
< prev
next >
Wrap
BASIC Source File
|
1990-10-14
|
5KB
|
139 lines
0 '+++ STL.BAS STL SYSTEM PLANNER +++
5 '+ BY RONALD F. BALONIS 5/20/87 +
10 '+ BASED ON TFT'S STL SYSTEM BOOK +
15 '+"A PRIMER: AURAL MICROWAVE LINKS"+
20 RUN 30
30 TLE$="+ 950 MHZ STL SYSTEM PLANNER +"
40 FO=.95:RD=45/ATN(1)
45 '
50 CLS:PRINT TAB(25) TLE$: PRINT
60 LINE INPUT "STL SYSTEM: ";STL$
70 IF STL$="" THEN STOP
80 '
90 PRINT:'---PROMPT FOR SYSTEM DATA
100 PRINT "STL SYSTEM GAINS :"
105 '
110 PRINT " TX POWER (WATTS) ";
115 INPUT TPWR$: TPWR=VAL(TPWR$)
120 IF TPWR<=0 THEN STOP
125 IF TPWR>100 THEN 0
130 TPWR=10*LOG(TPWR/.001)/LOG(10)
135 '
140 PRINT " TX ANTENNA GAIN (DB) ";
145 INPUT TXANT$: TXANT=ABS(VAL(TXANT$))
150 '
155 PRINT " ANTENNA ELEV <M/FT> ";
160 INPUT TELEV$: TELEV=ABS(VAL(TELEV$))
165 IF RIGHT$(TELEV$,1)="M" THEN 190
170 IF RIGHT$(TELEV$,2)<>"FT" THEN 0
175 '---SET CONSTANTS: METRIC OR ENGLISH
180 ELEV$="FT":UNIT$="MI":EK=.667
185 K=96.6:KK=1.609344:FK=72.1:GOTO 200
190 ELEV$="M ":UNIT$="KM":EK=.078
195 K=92.4:KK=1! :FK=17.3
198 '
200 PRINT " RX SIGNAL <DB/UV> ";
205 INPUT RSIG$: RSIG=-ABS(VAL(RSIG$))
210 RSIG$=RIGHT$(RSIG$,2)
215 IF RSIG$="UV" THEN 225
220 IF RSIG$="DB" THEN 235 ELSE 0
225 RSIG=20*LOG(ABS(RSIG)/224000!)/LOG(10)
230 '
235 PRINT " RX ANTENNA GAIN (DB) ";
240 INPUT RXANT$: RXANT=ABS(VAL(RXANT$))
245 '
250 PRINT " ANTENNA ELEV. ("ELEV$") ";
255 INPUT RELEV$: RELEV=ABS(VAL(RELEV$))
260 '
290 PRINT:LOCATE 5,39
300 PRINT"STL SYSTEM LOSSES:"
305 LOCATE 6,39
310 PRINT " PATH LENGTH ("UNIT$") ";
315 INPUT PATH$: PATH=ABS(VAL(PATH$))
325 IF PATH>0 THEN 400
330 '
335 LOCATE 7,40
340 PRINT " FROM: <LAT/LONG> ";
345 INPUT D$:J=INSTR(D$,"/")
350 IF J=0 THEN 0 ELSE GOSUB 8000:D1=D
355 D$=MID$(D$,J+1,6):GOSUB 8000:D2=D
360 LOCATE 8,40
365 PRINT " TO : <LAT/LONG> ";
370 INPUT D$:J=INSTR(D$,"/")
375 IF J=0 THEN 0 ELSE GOSUB 8000:D3=D
380 D$=MID$(D$,J+1,6):GOSUB 8000:D4=D
385 GOSUB 5000:LOCATE 9,40
390 PRINT USING" PATH LENGTH = ###.##";PATH;
395 PRINT UNIT$" AT ";USING"N ###.##E";BRG
398 '
400 '----CALCULATE SPACE LOSS OVER PATH
405 SPACE=K+20*LOG(.95)/LOG(10)+20*LOG(PATH)/LOG(10)
410 LOCATE 10,39
415 PRINT " TXLINE LOSS (DB) ";
420 INPUT XLOSS$: XLOSS=ABS(VAL(XLOSS$))
430 '
450 LOCATE 11,39
455 PRINT " OTHER LOSSES (DB) ";
460 INPUT OTHER$: OTHER=ABS(VAL(OTHER$))
490 '
500 LOCATE 13,1
505 PRINT "SYSTEM CALCULATIONS:"
510 PRINT " TXPWR + TXANT + RXANT = TOTAL GAIN"
515 TGAIN=TPWR+TXANT+RXANT
520 PRINT USING " ###.# +";TPWR;TXANT;
525 PRINT USING " ###.# = ###.# DB";RXANT;TGAIN
530 LOCATE 14,39
535 PRINT " PATH + TXLINE+ OTHER = TOTAL LOSS"
540 TLOSS=SPACE+XLOSS+OTHER
545 LOCATE 15,39
550 PRINT USING " ###.# +";SPACE;XLOSS;
555 PRINT USING " ###.# = ###.# DB";OTHER;TLOSS
560 PRINT
600 PRINT " RX'D SIG - RX SIG = FADE MARGIN"
605 SIGNAL=TGAIN-TLOSS:FADE=SIGNAL-RSIG
610 PRINT USING" ###.# - ###.# ";SIGNAL;RSIG;
615 PRINT USING" = ###.# DB";FADE
620 LOCATE 17,39:DD=PATH*KK/1.609344:A=1:B=.25:'AVERAGE & INLAND
625 PREL=100-100*(A*B*.0000025*FO*DD*DD*DD*EXP(-FADE/10*LOG(10)))
630 PRINT USING" PATH RELIABILITY = ###.##### %";PREL
635 LOCATE 18,39
655 FZ=.6*FK*SQR(((PATH/2)^2)/(FO*PATH))
660 PRINT USING" 0.6 FRESNEL RADIUS = ###.# \ \";FZ;ELEV$
675 LOCATE 19,40
680 PRINT"[ TX ] --> PATH PROFILE [%DISTANCE]/[DISTANCE]/[REQ'D CLEARELEV] --> [ RX ]"
715 PRINT
800 PRINT"[ 0% ][ 10% ][ 20% ][ 30% ][ 40% ][ 50% ][ 60% ][ 70% ][ 80% ][ 90% ][100% ]"
805 FOR I=0 TO 10 STEP 1
810 PRINT USING "[###.#]";PATH*I/10;
815 NEXT I
820 PRINT:D=PATH
825 '
830 PRINT USING "####.# ";TELEV;
840 FOR I=1 TO 9 STEP 1
845 EBULGE=EK*(D*I/10)*(D-D*I/10)
850 FZ=.6*FK*SQR(((D*I/10)*(D-D*I/10))/(FO*D))
855 HT=RELEV*(TELEV>=RELEV)-TELEV*(RELEV>TELEV)
860 CLR=HT-FZ-EBULGE+ABS(TELEV-RELEV)*I/10
865 PRINT USING "####.# ";ABS(CLR);
870 NEXT I
880 PRINT USING "####.#";RELEV;
890 A$=INPUT$(1):RUN 0
1000 '
5000 '---COMPUTE DIST&BRG BY 73.208 WAY
5100 D6=ABS(D3-D1):D7=ABS(D4-D2):D=(D1+D3)/2
5200 IF D<25 OR D>50 THEN RUN 0 ELSE D=D/RD
5400 LA=D6*(111.13209#-.56605*COS(2*D)+.0012*COS(4*D))
5500 LB=D7*(111.41513#*COS(D)-.09455*COS(3*D)+.00012*COS(5*D))
7000 IF LA>0 THEN BRG=ATN(LB/LA)*RD ELSE BRG=90
7010 IF D1>D3 AND D2>D4 THEN BRG=180-BRG
7020 IF D1>D3 AND D2<=D4 THEN BRG=180+BRG
7030 IF D1<=D3 AND D2<=D4 THEN BRG=360-BRG
7040 PATH=SQR(LA*LA+LB*LB)/KK:RETURN
7050 '-CONVERT LAT/LONG TO DECIMAL DEG.
8000 L=VAL(D$):I=INSTR(D$,".")
8005 F=(I<>0)*(I<5)-2*(I>4)-3*(I=0)
8010 IF F=1 THEN D=L:RETURN
8015 IF F=3 THEN GOSUB 8020:L=D
8020 D=INT(L/100):D=D+(L-D*100)/60:RETURN
8025 '--------END OF PROGRAM-----------